package com.metrics.calculators;

import com.database.daos.IMaxDao;
import com.database.objects.*;

public class MetricCyclomaticComplexityCalculator extends MetricCalculator {

	private static final long serialVersionUID = 3835600686021338755L;

	private IMaxDao maxDao;

	@Override
	public void calculate(Developer developer, String date, Type type, Status status, Contribution contribution) {
		Double value = maxDao.getMaxCyclomaticByDeveloperAndDateAndTypeAndStatus(developer, date, type, status);
		contribution.setCyclomatic(value);
	}

	public void setMaxDao(IMaxDao maxDao) {
		this.maxDao = maxDao;
	}

}